#ifndef CLIENTTCP_H
#define CLIENTTCP_H

#include <QObject>
#include <QString>
#include <QtNetwork>
#include <QAbstractSocket>

class clienttcp : public QObject
{
    Q_OBJECT
public:
    explicit clienttcp(QObject *parent = 0);

public slots:
    void send(const QString& meg);
    void setPort(const qint16& port);
    void setAddress(const QString& address);

private slots:
    void newConnect();
    void sendMessage();
    void displayError(QAbstractSocket::SocketError);

protected:
    QString getLocalHostIP();

private:
    QTcpSocket tcpSocket;
    qint16 tcpPort;
    QString serverAddress;
    QString message;
};

#endif // CLIENTTCP_H
